package com.mapull.example.section1;

import java.math.BigDecimal;

/**
 * @author Mapull
 * @date 2024-03-20
 */
public class StringValueOf {


    public static void main(String[] args) {
        BigDecimal big = null;
        System.out.println(String.valueOf(big));
        System.out.println(String.valueOf(null));
    }

    public static void main9(String[] args) {
        BigDecimal big = null;
        System.out.println(String.valueOf(big));
        System.out.println(String.valueOf(big).equals(null));
        System.out.println(String.valueOf(big).equals("null"));
        System.out.println(String.valueOf(new BigDecimal("1.2")));
    }
    public static void main6(String[] args) {
        char[] data = {'W', 'o', 'r', 'l', 'd'};
        System.out.println(String.valueOf(data,0,2));
        System.out.println(String.valueOf(data,2,2));
        System.out.println(String.valueOf(data,3,4));
    }
    public static void main5(String[] args) {
        System.out.println(String.valueOf(10086L));
        System.out.println(String.valueOf(9999999L));
    }
    public static void main4(String[] args) {
        System.out.println(String.valueOf(1024));
        System.out.println(String.valueOf(0));
    }
    public static void main3(String[] args) {
        System.out.println(String.valueOf('a'));
        System.out.println(String.valueOf('1'));
        System.out.println(String.valueOf('好'));
    }
    public static void main2(String[] args) {
        boolean bool = true;
        String str = String.valueOf(bool);
        System.out.println(str);
        System.out.println(str.equals("true"));
    }
}
